import React from 'react'
import Count from './Count'
import Test from './Test'
import { connect } from 'react-redux'
const WithCount = connect(function mapStateToProps(state) {
  console.log(state)
  // return 的对象里面有什么.则Count组件通过props就可以接收到什么
  return {
    c: state.count,
  }
})(Count)

const WithTest = connect(function (state) {
  return {
    c: state.count,
  }
})(Test)
/*
 function connect(){
  return function(){
    return class Far extends Component{

    }
  }
 }
*/
export default function App() {
  return (
    <div>
      App
      <hr />
      <WithCount></WithCount>
      ==========================
      <WithTest></WithTest>
    </div>
  )
}
